package com.baizhi.dao.jpa;

import com.baizhi.domain.jpa.Article;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

// 自定义接口需要继承JpaRepository<实体类类型, 实体类主键类型>, JpaSpecificationExecutor<实体类类型>
public interface ArticleDao extends JpaRepository<Article, Integer>, JpaSpecificationExecutor<Article> {

    @Modifying
    @Query(value = "drop table article", nativeQuery = true)
    void dropTable();
}
